SRCS += $(wildcard *.c)
SRCS += $(wildcard *.cpp)
TARGETS = $(foreach src, $(SRCS), $(basename $(src)))

CXX = g++

CFLAGS += -pipe -Wall -g -DLBTEST
CFLAGS += -I..
CDFLAGS += -L.. -l lbutils

.PHONY: all clean

all : $(TARGETS)

$(TARGETS) : % : %.o
	$(CXX) -o $@ $< $(CDFLAGS)

clean:
	-rm $(TARGETS) *.o

#######################################
.SUFFIXES : .cpp .c

.cpp.o :
	$(CXX) $(CFLAGS) -c -o $@ $<

.c.o :
	$(CXX) $(CFLAGS) -c -o $@ $<

